/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.entity;

import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;

import javax.persistence.*;
import java.util.Set;

/**
 * Author: Sergey42
 * Date: 14.10.13 12:19
 */
@Table(name = "EXT_STUDENT_GROUP")
@Entity(name = "ext$StudentGroup")
@NamePattern("%s|number")
public class StudentGroup extends StandardEntity {

    private static final long serialVersionUID = -8513537374656268667L;

    @ManyToOne
    @JoinColumn(name = "FACULTY_ID")
    protected Faculty faculty;

    @Column(name = "NUMBER", length = 20)
    protected String number;

    @OneToMany(mappedBy = "studentGroup")
    protected Set<Student> students;

    @OneToOne
    @JoinColumn(name = "CAPTAIN_ID")
    protected Student captain;

    @Column(name = "COURSE")
    protected Integer course = 1;

    @Column(name = "PERFORM_YEAR")
    protected Integer performYear;

    @ManyToOne
    @JoinColumn(name = "SPECIALITY_ID")
    protected Speciality speciality;

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public Set<Student> getStudents() {
        return students;
    }

    public void setStudents(Set<Student> students) {
        this.students = students;
    }

    public Integer getCourse() {
        return course;
    }

    public void setCourse(Integer course) {
        this.course = course;
    }

    public Integer getPerformYear() {
        return performYear;
    }

    public void setPerformYear(Integer performYear) {
        this.performYear = performYear;
    }

    public Student getCaptain() {
        return captain;
    }

    public void setCaptain(Student captain) {
        this.captain = captain;
    }

    public Faculty getFaculty() {
        return faculty;
    }

    public void setFaculty(Faculty faculty) {
        this.faculty = faculty;
    }

    public Speciality getSpeciality() {
        return speciality;
    }

    public void setSpeciality(Speciality speciality) {
        this.speciality = speciality;
    }
}
